<template>
  <router-view/>
</template>
<script setup>
	import {ref,onMounted} from "vue"
	import {http} from "./components/http.js"
	import router from "./router/index.js"
	onMounted(()=>{
		console.log("apponmounted")
		http({url:"/userInfo",method:"get"}).then(res=>{
			// menuList.value = res.data.data.menu
			// router.addRoute("index",{path:"/user",component:()=>import("@/views/user.vue")})
			res.data.data.menu.forEach((item)=>{
				router.addRoute("index",{path:"/"+item.url,component:()=>import(`@/${item.path}`)})
				console.log(router)
			})
			router.replace("/user")
		})
	})
</script>
<style>
*{
	padding:0;
	margin:0;
}
</style>
